<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>添加员工</title>
<link rel="shortcut icon" href="favicon.ico">
<link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="css/plugins/chosen/chosen.css" rel="stylesheet">
<link href="css/plugins/colorpicker/css/bootstrap-colorpicker.min.css"
	rel="stylesheet">
<link href="css/plugins/cropper/cropper.min.css" rel="stylesheet">
<link href="css/plugins/switchery/switchery.css" rel="stylesheet">
<link href="css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
<link href="css/plugins/nouslider/jquery.nouislider.css"
	rel="stylesheet">
<link href="css/plugins/datapicker/datepicker3.css" rel="stylesheet">
<link href="css/plugins/ionRangeSlider/ion.rangeSlider.css"
	rel="stylesheet">
<link href="css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css"
	rel="stylesheet">
<link
	href="css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
	rel="stylesheet">
<link href="css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
<link href="css/animate.min.css" rel="stylesheet">
<link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="form-group">
			<label class="col-sm-2 control-label">员工姓名</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="Empname">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<label class="col-sm-2 control-label">登陆名</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="Account">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<label class="col-sm-2 control-label">手机号码</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="Empphone">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group draggable">
			<label class="col-sm-2 control-label">性别 </label>
			<div class="col-sm-10">
				<div class="radio radio-info radio-inline">
					<input type="radio" checked="" value="1" id="inlineRadio1"
						name="radioInline"> <label for="inlineRadio1">男</label>
				</div>
				<div class="radio radio-info radio-inline">
					<input type="radio" value="2" id="inlineRadio2" name="radioInline">
					<label for="inlineRadio2">女</label>
				</div>
			</div>
		</div>

		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<label class="col-sm-2 control-label">住址</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="Empaddr">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<label class="col-sm-2 control-label">登录密码</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="Emppwd">
			</div>
		</div>
		<div class="hr-line-dashed"></div>
		<div class="form-group">
			<div class="col-sm-4 col-sm-offset-2">
				<button class="btn btn-primary" id="save">保存</button>
				<button class="btn btn-white">取消</button>
			</div>
		</div>

	</div>

	<script src="js/jquery.min.js?v=2.1.4"></script>
	<script src="js/bootstrap.min.js?v=3.3.6"></script>
	<script src="js/content.min.js?v=1.0.0"></script>
	<script src="js/plugins/iCheck/icheck.min.js"></script>
	<script src="js/plugins/layer/laydate/laydate.js"></script>
	<script src="js/plugins/chosen/chosen.jquery.js"></script>
	<script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<script src="js/plugins/jsKnob/jquery.knob.js"></script>
	<script src="js/plugins/clockpicker/clockpicker.js"></script>
	<script src="js/plugins/jasny/jasny-bootstrap.min.js"></script>
	<script src="js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<script src="js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
	<script src="js/plugins/switchery/switchery.js"></script>
	<script src="js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
	<script src="js/plugins/iCheck/icheck.min.js"></script>
	<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="js/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
	<script type="text/javascript">
	$("#save").click(function() {
		var Empname = $("#Empname").val();
		var Account = $("#Account").val();
		var sex = $('input:radio:checked').val();
		var Empphone = $("#Empphone").val();
		var Empaddr = $("#Empaddr").val();
		var Emppwd = $("#Emppwd").val();
		var data = {
			"account":Account,
			"name" : Empname,
			"sex" : sex,
			"phone" : Empphone,
			"address" : Empaddr,
			"password" : Emppwd
		};
		add(data);
	})

	function add(data) {
		$.ajax({
			type : "POST", // 请求方式
			url : "sysuser/addUser", // 请求路径
			headers : {
				'content-Type' : 'application/json'
			},
			dataType : 'json',
			data : JSON.stringify(data),
			success : function(data) {
				console.log(data);
				if (data.httpCode == "200") {
					console.log(data.data);
					window.location.href='settingEmp.html';
				} else {
					// alert("登录失败");
					showmessage01('登录失败!');
				}
			},
			error : function() {
				alert("errr");
			}
		});

	}
	</script>
</body>

</html>